#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+5,mod=1e9+7;
int x,y,dp[N];
signed main() {
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>x>>y;
	dp[x]=1;
	for(int i=x+1;i<=y;i++){
		if(i%2==0) dp[i]=dp[i/2];
		dp[i]=(dp[i]+dp[i-1])%mod;
	}
	cout<<dp[y];
	return 0;
}
